<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>基本信息</title>
		<meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;" />
		<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">
		<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
		
		<link rel="stylesheet" type="text/css" href="css/all.css"/>
	</head>
	<body>
		<style type="text/css">
			.container{ padding-top: 15px;}
			.col-xs-3 { line-height: 35px; color: #999; }
			.col-xs-8,.col-xs-4{ margin-left: 0; padding-left: 0;}
			.row{ padding-top: 8px; padding-bottom: 8px; border-bottom:1px #EAEAEA solid ;}
			.form-control{ color: #333 !important; border: none;}
			.yanzhengma{ line-height: 30px; padding: 0px 8px; border: 1px #EAEAEA solid; color: #000; z-index: 999; border-radius: 3px;
			 position: absolute; right: 25px; top: 10px;}
			.form-control{ background: none !important;}
			.form-control:focus {border-color: #66afe9; outline: 0;-webkit-box-shadow: inset 0px 0px 5px #FFFFFF}	
			 .go{background: #ffa328; font-weight: 600; color: #FFFFFF; text-align: center; font-size: 1.6rem; padding: 10px 0; margin-top: 20px; border-radius: 5px;}
			.xz{ padding: 8px 10px; background: #FFFFFF; color: #000; border: 1px #EAEAEA solid; border-radius: 5px; overflow: hidden; line-height: 35px; }
			.xzhover{background: #ffa328; color: #FFFFFF; }
			.tx{ margin: 0 auto; width: 80px; height: 80px; margin-bottom: 15px;}
			.tx img{ width: 80px; height: 80px; border-radius: 40px; display: block;}
		</style>
		<div class="heimu"></div>
		<div class="fabuactive">正在加载，请稍后....</div>
		<div class="alltop">
			<div class="backone2">
				<a href="javascript:;" class="returna"><span class="glyphicon glyphicon-menu-left"></span><b>返回</b></a>
			</div>
			<div class="refresh">
			<a href="#">
				<span class="glyphicon glyphicon-refresh"></span><b>刷新</b>
				</a>
			</div>
		</div>		
		<div class="container">
			<!--<div class="row tx">
				<img src="img/t1.jpg"/>
			</div>-->
			<div class="row">
				<div class="col-xs-3 col-xs-offset-1">姓名</div>
				<div class="col-xs-8"><input type="text" class="form-control username" name="" id="name" placeholder="姓名"/></div>
			</div>
			<div class="row">
				<div class="col-xs-3 col-xs-offset-1">性别</div>
				<div class="col-xs-8">
					<span class="xz xzhover" data-id="1">男</span>
					<span class="xz" data-id="2">女</span>
				</div>
			</div>

			<div class="row">
				<div class="col-xs-3 col-xs-offset-1">年龄</div>
				<div class="col-xs-8"><input type="text" class="form-control age" name="" id="age" value="" placeholder="请输入年龄" /></div>
			</div>

			<div class="go">确认</div>
		</div>
		<script type="text/javascript" src="../lib/jquery.min.js"></script>
		<script type="text/javascript" src="../lib/bootstrap.min.js"></script>
		<script type="text/javascript" src="../lib/vue.min.js"></script>
		<script type="text/javascript" src="../lib/common.js"></script>
		<script src="../lib/soha.js" type="text/javascript"></script>
		
		<script type="text/javascript">
		var accountid ;
		var picurl ;
		var username ;
		var sex ;
		var phone ;
		var age ;
			$(function(){
				$(".heimu").show();
				$(".fabuactive").show();
				 var b = new Base64(); //加密
				 query = ''+GetQueryString("userid");
				       
				accountid = parseInt(b.decode(query)); //解密urlid
				postJSON('/api/getoneaccountapplyjob', { "id": parseInt(accountid), }, function(result) {

				   picurl = result.data[0].picurl;
				   sex = result.data[0].sex;
				   phone = result.data[0].phone;
				   age = result.data[0].age;

				    $('.age').val(result.data[0].age) ;
				    $('.username').val(result.data[0].username) ;
				    if ( result.data[0].sex == "男" ) {
				    	$('.xz').eq(0).addClass("xzhover").siblings().removeClass("xzhover");
				    }
				    if ( result.data[0].sex == "女" ) {
				    	$('.xz').eq(1).addClass("xzhover").siblings().removeClass("xzhover");
				    }

				   $(".heimu").hide();
				$(".fabuactive").hide();
				}, function(result) {

				});

			})
			
			$(".xz").click(function(){

            	$(this).addClass("xzhover").siblings().removeClass("xzhover")
            })
			$(".go").click(function(){
				$(".fabuactive").show();
				username = $('.username').val();
				age = $('.age').val();
				sex = $('.xzhover').html();
				console.log(sex)
				 postJSON('/api/uploadaccountmsg', { 
                                            "id": parseInt(accountid), 
                                            "picurl": picurl ,
                                            "username": username ,
                                            "sex": sex ,
                                            "phone": phone ,
                                            "age": parseInt(age) ,
                                            "atype": 0 ,
                    }, function(result) {
                        $(".fabuactive").hide();
                        alert("更改成功！")
                        window.history.go( -1 );  
                        }, function(result) {

                        });
			})

		</script>
		<script src="js/peizhi.js" type="text/javascript" charset="utf-8"></script>
	</body>
</html>
